package br.ufpe.cin.imlm2.jbeat.soot.common.filters;

import java.util.Collection;
import java.util.HashSet;

import soot.SootClass;

import br.ufpe.cin.imlm2.util.filter.IFilter;

/**
 * An abstract filter for <code>SootClass</code> objects.
 * 
 * @author Irineu
 * 
 */
public abstract class SootClassFilter implements IFilter<SootClass> {

	@Override
	public Collection<SootClass> filter(Collection<SootClass> collection) {
		Collection<SootClass> filtered = new HashSet<SootClass>();
		for (SootClass sootClass : collection) {
			if (!this.retains(sootClass))
				filtered.add(sootClass);
		}
		return filtered;
	}
}
